<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>
<h:body>

	<h:form>
		<p:growl id="messages"/> 
        <p:menubar model="#{userMenuBean.model}" />
            
		<h:panelGrid columns="4">
			<p>Welcome, #{indexBean.firstName}</p>
			<p:commandLink id="logoutLink" actionListener="#{indexBean.logout}">
				<h:outputText value="Logout" />
			</p:commandLink>
			<p:commandLink id="updateUserInfo"
				actionListener="#{indexBean.redirectToUpdateUserInfo}">
				<h:outputText value="Update User" />
			</p:commandLink>
			<p:commandLink id="createActivity"
				actionListener="#{indexBean.redirectToCreateActivityBean}">
				<h:outputText value="Create Activity" />
			</p:commandLink>
			
			



			
			<p:dataTable var="activity" value="#{activityTableBean.activities}"
				id="activityList" editable="true">
				<f:facet name="header">
                             In-Cell Editing
                </f:facet>
				
				<!--  
				<p:ajax event="rowEdit" listener="#{activityTableBean.onEdit}"
					update=":form:messages" />
				<p:ajax event="rowEditCancel"
					listener="#{activityTableBean.onCancel}" update=":form:messages" />  -->

				<p:column headerText="Id" style="width:30%">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{activity.id}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{activity.id}" style="width:100%" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Created Date" style="width:20%">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{activity.createdDate}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{activity.createdDate}" style="width:100%"
								label="Created Date" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Owner" style="width:24%">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{activity.owner}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{activity.owner}" style="width:100%"
								label="Owner" />
						</f:facet>
					</p:cellEditor>
				</p:column>

				<p:column headerText="Updated Date" style="width:20%">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{activity.updatedDate}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{activity.updatedDate}" style="width:100%"
								label="Updated Date" />
						</f:facet>

					</p:cellEditor>
				</p:column>

				<p:column headerText="Description" style="width:20%">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{activity.description}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{activity.description}" style="width:100%"
								label="Description" />
						</f:facet>

					</p:cellEditor>
				</p:column>

				<p:column headerText="Start Date" style="width:20%">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{activity.startDate}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{activity.startDate}" style="width:100%"
								label="Start Date" />
						</f:facet>

					</p:cellEditor>
				</p:column>

				<p:column headerText="End Date" style="width:20%">
					<p:cellEditor>
						<f:facet name="output">
							<h:outputText value="#{activity.endDate}" />
						</f:facet>
						<f:facet name="input">
							<p:inputText value="#{activity.endDate}" style="width:100%"
								label="End Date" />
						</f:facet>

					</p:cellEditor>
				</p:column>


				<p:column style="width:6%">
					<p:rowEditor />
				</p:column>

			</p:dataTable>

		</h:panelGrid>
	</h:form>
</h:body>
</html>